** Replication Code for:
** Terrorism Activates Ethnocentrism to Explain Greater Willingness to 
** Sacrifice Civil Liberties: Evidence from Germany
** Authors: Christina Novak Hansen and Peter Thisted Dinesen 
** Date: 10/02/2021

*-------------------------------------------------------------------------------


*-------------------------------------------------------------------------------
*Appendix F: Conceptualizing and operationalizing ethnocentrism
*-------------------------------------------------------------------------------

clear all
use GGSS2016_analysis.dta


				
********************************************************************************
*F2 Operationalization and delineation from other related concepts
********************************************************************************


*Statistics for whole German sample
spearman st_foreign_advantage st_homocult st_imrights st_wlife st_immarry ///
st_stranger st_imenrich st_imcoherence st_imsocial st_diversity if st_terrori!=. ///
	& st_ethno!=. & sex!=. & st_age!=. & proedu2!=. & work2!=. & treatment1!=. ///
	& german==1, stats(rho obs p)
factor st_foreign_advantage st_homocult st_imrights st_wlife st_immarry ///
st_stranger st_imenrich st_imcoherence st_imsocial st_diversity [aweight = wghtpew] ///
	if st_terrori!=. & st_ethno!=. & sex!=. & st_age!=. & proedu2!=. ///
	& work2!=. & treatment1!=. & german==1, pcf
rotate

alphawgt st_foreign_advantage st_homocult st_imrights st_wlife st_immarry ///
	st_stranger st_imenrich st_imcoherence st_imsocial st_diversity ///
	[aweight = wghtpew] if st_terrori!=. & st_ethno!=. & sex!=. & st_age!=. ///
	& proedu2!=. & work2!=. & treatment1!=. & german==1, casewise item



*Statistics for studied subsample
clear all
use GGSS2016_analysis.dta
svyset xs11 [pweight=wghtpew], vce(linearized)
keep if german==1 & governmentsplit!=. & treatment1!=.				



*Analyzing if "Way of life" variable (difference in wording) changes the results
*Inspecting means and standard deviations			
svy: mean st_wlife if st_split_a_WL!=. & st_terrori!=. & st_ethno!=. & sex!=. ///
	& st_age!=. & proedu2!=. & work2!=. & treatment1!=. & german==1
estat sd
svy: mean st_wlife if st_split_b_WL!=. & st_terrori!=. & st_ethno!=. & sex!=. ///
	& st_age!=. & proedu2!=. & work2!=. & treatment1!=. & german==1
estat sd

			

 
********************************************************************************
*F3: Addressing the difference in question working of one ethnocentrism indicator
********************************************************************************


										*Table F1*
*Full ethnocentrism index
*SPLIT A
svy: regress st_terrori c.st_ethno i.sex st_age st_age2 i.proedu2 i.work2 if treatment1!=. & st_split_a_WL!=. & german==1
outreg2 using Table_F1.xls, drop(i.sex st_age st_age2 i.proedu2 i.work2) nocons stats(coef se) dec(2) symbol(*,**) alpha(0.05,0.01) label(proper) replace 
svy: regress st_terrori c.st_ethno i.treatment1 i.sex st_age st_age2 i.proedu2 i.work2 if st_split_a_WL!=. & german==1
outreg2 using Table_F1.xls, drop(i.sex st_age st_age2 i.proedu2 i.work2) nocons stats(coef se) dec(2) symbol(*,**) alpha(0.05,0.01) label(proper) append 
svy: regress st_terrori c.st_ethno##i.treatment1 i.sex st_age st_age2 i.proedu2 i.work2 if st_split_a_WL!=. & german==1
outreg2 using Table_F1.xls, drop(i.sex st_age st_age2 i.proedu2 i.work2) nocons stats(coef se) dec(2) symbol(*,**) alpha(0.05,0.01) label(proper) append
*SPLIT B
svy: regress st_terrori c.st_ethno i.sex st_age st_age2 i.proedu2 i.work2 if treatment1!=. & st_split_b_WL!=. & german==1
outreg2 using Table_F1.xls, drop(i.sex st_age st_age2 i.proedu2 i.work2) nocons stats(coef se) dec(2) symbol(*,**) alpha(0.05,0.01) label(proper) append 
svy: regress st_terrori c.st_ethno i.treatment1 i.sex st_age st_age2 i.proedu2 i.work2 if st_split_b_WL!=. & german==1
outreg2 using Table_F1.xls, drop(i.sex st_age st_age2 i.proedu2 i.work2) nocons stats(coef se) dec(2) symbol(*,**) alpha(0.05,0.01) label(proper) append 
svy: regress st_terrori c.st_ethno##i.treatment1 i.sex st_age st_age2 i.proedu2 i.work2 if st_split_b_WL!=. & german==1
outreg2 using Table_F1.xls, drop(i.sex st_age st_age2 i.proedu2 i.work2) nocons stats(coef se) dec(2) symbol(*,**) alpha(0.05,0.01) label(proper) append


